package basic

import (
	"github.com/prometheus/client_golang/prometheus"
)

var logger = XCLogger{}

var (
	requestCount = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "http_requests_total",
		Help: "Total number of HTTP requests",
	})
	requestDuration = prometheus.NewHistogram(prometheus.HistogramOpts{
		Name:    "http_request_duration_seconds",
		Help:    "The HTTP request latencies in seconds.",
		Buckets: []float64{0.1, 0.3, 0.6, 1.0, 2.0, 4.0, 8.0},
	})
)

func CountRequest() {
	requestCount.Add(1)
}

func init() {
	prometheus.MustRegister(requestCount)
	prometheus.MustRegister(requestDuration)
}
